@section('css')
 {{ HTML::style('assets/js/jwysiwyg/jquery.wysiwyg.css') }}
 {{ HTML::style('assets/css/admin.css') }}
@stop
@section('content')
<div class="am-cf am-padding">
   <div class="am-fl am-cf">
      <a href="{{URL::route('notice')}}"><strong class="am-text-primary am-text-lg">通知</strong></a> / <small>添加</small>
   </div>
</div>
<form class="am-form am-form-horizontal" id="noticeAddForm" name="noticeAddForm"
	method="post" action="{{URL::route('notice.update')}}">
  <div class="am-form-group">
    <label for="title" class="am-u-sm-2 am-form-label">标题</label>
    <div class="am-u-sm-5">
      <input type="text" id="title" name="title" placeholder="输入通知标题" value="{{$notice->title}}"
      	data-rules="required|max_length[64]" class="validate" data-display="通知标题">
    </div>
    <p class="am-u-sm-5 help-block"></p>
  </div>
  <div class="am-form-group">
    <label for="start" class="am-u-sm-2 am-form-label">起始时间</label>
    <div class="am-u-sm-5">
      <input type="text" id="start" name="start"  value="{{$notice->start}}"
      	class="am-form-field am-radius validate" placeholder="输入起始时间" data-am-datepicker readonly
      	data-rules="required" data-display="起始时间"/>
    </div>
    <p class="am-u-sm-5 help-block"></p>
  </div>
  <div class="am-form-group">
    <label for="end" class="am-u-sm-2 am-form-label">结束时间</label>
    <div class="am-u-sm-5">
      <input type="text" id="end" name="end" value="{{$notice->end}}"
      	class="am-form-field am-radius validate" placeholder="输入结束时间" data-am-datepicker="{autoClose:true}" readonly
      	data-rules="required" data-display="结束时间"/>
    </div>
    <p class="am-u-sm-5 help-block"></p>
  </div>
  <div class="am-form-group">
    <label for="title" class="am-u-sm-2 am-form-label">节假日</label>
    <div class="am-u-sm-5">
      <input type="text" id="holiday" name="holiday" placeholder="输入节假日" value="{{$notice->holiday}}"
      	data-rules="max_length[64]" class="validate" data-display="节假日">
    </div>
    <p class="am-u-sm-5 help-block"></p>
  </div>
   <div class="am-form-group">
	    <label for="content" class="am-u-sm-2 am-form-label">通知内容</label>
	    <div class="am-u-sm-5">
	      <textarea id="content" name="content" placeholder="输入通知内容"
	      	data-rules="required|max_length[512]" class="validate" data-display="通知内容">{{$notice->content}}</textarea>
	    </div>
	    <p class="am-u-sm-5 help-block"></p>
   </div>

  <div class="am-form-group">
    <div class="am-u-sm-10 am-u-sm-offset-2">
      <input id="id" name="id" type="hidden" value="{{$notice->id}}">
      <button type="submit" class="am-btn am-btn-primary">添加</button>
    </div>
  </div>
</form>
@stop

@section('script')
<script type="text/javascript">
<!--
$.browser = {};
$.browser.mozilla = /firefox/.test(navigator.userAgent.toLowerCase());
$.browser.webkit = /webkit/.test(navigator.userAgent.toLowerCase());
$.browser.opera = /opera/.test(navigator.userAgent.toLowerCase());
$.browser.msie = /msie/.test(navigator.userAgent.toLowerCase());
//-->
</script>
{{ HTML::script('assets/js/jwysiwyg/jquery.wysiwyg.js') }}
{{ HTML::script('assets/js/jwysiwyg/plugins/wysiwyg.rmFormat.js') }}
<script type="text/javascript">
$(function () {
	//初始化产品基础信息
	var eidtorOptions = {
			autoGrow:true,
			rmUnusedControls: true,
			controls: {
				bold: { visible : true },
				italic: { visible : true },
				undo: { visible : true },
				redo: { visible : true },
				removeFormat: { visible : true }
			},
			plugins: {
				rmFormat: { rmMsWordMarkup: true }
			}
		};
	$('#content').wysiwyg(eidtorOptions);
	$("#start,#end").on("changeDate.datepicker.amui",function(){
		 $(this).datepicker('close');
	});
	$("#noticeAddForm").validate();
});
</script>
@stop
